""" DigitalICS: mobile data collection tool to complete surveys with integrated multimedia

    Copyright (C) 2009. Yael Schwartzman  

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>
    
    Contact information: Yael Schwartzman -  yaelsf@gmail.com
    """
from api.form import Form
from api.constants import Constants


def enform1(community,municipio,localidad,producer):
    c = Constants()
    form = Form()
    form.set_id("Section1")
    form.set_name("General Information")
    form.set_community_id(community)
    form.set_producer_id(producer)
    form.set_municipio_id(municipio)
    form.set_localidad_id(localidad)
    
    form.set_module("enform1")

 
    form.add_mult_data(['coffee_surface','parcels','inspected_parcel','inspector',
                        "inspection_date","inspector","ts1","ts2"])
   
    form.add_prompt(id ="1.coffee_surface",
                    data = "coffee_surface",
                    input_type = c.INPUT,
                    return_type = c.RETURN_FLOAT,
                    label = "1. Total coffee hectares:",
                    audio = "1.2coff_surf",
                    output = "1. TOTAL COFFEE HECTARES: #VAR HA" )
   
    form.add_prompt(id = '2.parcels',
                    data = 'parcels',
                    label = "2. Number of parcels with coffee:", 
                    input_type = c.INPUT,
                    return_type = c.RETURN_INTEGER,
                    audio = "1.3parcels",
                    output = "#label  #VAR" )
   
    form.add_prompt(id = '3.inspected',
                    data = 'inspected_parcel',
                    label = "3. Number of inspected parcel:",
                    input_type = c.INPUT,
                    return_type = c.RETURN_INTEGER,
                    audio = "1.4insp_parc",
                    output = "#label  #VAR " ),

    form.add_prompt(id = '4.inspector',
                    data = 'inspector',
                    label = "4. Inspector ID number:",
                    input_type = c.INPUT,
                    return_type = c.RETURN_INTEGER,
                    audio = "inspector_en",
                    output = "#label  #VAR " ),
    
    form.add_prompt(id = "5.inspection_date",
                    data = 'inspection_date',
                    label ="5. Inspection date:",
                    input_type = c.INPUT,
                    return_type = c.RETURN_DATE,
                    audio = "1.5date",
                    output = "#label #VAR")
    return form
